const SAVE_CITY_POSITION = "SAVE_CITY_POSITION";


const initState = {
    cityPosition: [],
}



export function position(state=initState, action) {
    switch(action.type) {
        case SAVE_CITY_POSITION:
            return {...state,...action.payload};
        default:
            return state;
    }
}

function cityPosition(data) {
     return {type:SAVE_CITY_POSITION, payload:{cityPosition:data}}
}



export  function actionCityPosition(data) {
    return dispatch => {
        dispatch(cityPosition(data));
    }
}